#include "comm.hpp"

int main()
{
    //创建mmap映射
    Mmap mp(MMAP_FILE, 4096);

    //使用命名管道
    int fd = FIFO::open_write(FIFO_FILE);

    //进程通信代码
    char* str = (char*)mp.get();
    while (true)
    {
        std::cout << "Please Enter: ";

        fgets(str, 4096, stdin);
        str[strlen(str) - 1] = '\0';
        
        char sign = 'c';
        write(fd, &sign, sizeof(sign));
    }
    close(fd);

    return 0;
}
